package com.omaitec.log4j.mq.expand;

import javax.jms.Message;
import javax.jms.MessageListener;

import org.apache.activemq.command.ActiveMQObjectMessage;

public class LogMessageListener implements MessageListener {
    public void onMessage(Message message) {
	try {
	    LoggingEventWrapper event = (LoggingEventWrapper) ((ActiveMQObjectMessage) message)
		    .getObject();
	    System.out.println("Received log [" + event.getHostName() + "]: "
		    + event.getMessage());
	} catch (Exception e) {
	    e.printStackTrace();
	}
    }
}
